Skip to content

Conversation

@tobio
Copy link
Member

@tobio tobio commented Oct 24, 2024

SDK based api_key resources stored expiration:"" in state when it's unset in config, however PF based resources more specifically model this as null. This is causing TF to force the replacement of API Keys when upgrading from 0.11.10.

This PR updates the RequiresReplace logic to only require replacement when the expiration value actually changes (e.g 1d -> null). It also adds an acceptance test verifying provider behaviour during the migration from SDK->PF, specifically that the underlying API Key is not replaced.

Fixes #873

@tobio tobio requested a review from wandergeek October 24, 2024 19:32
@tobio tobio self-assigned this Oct 24, 2024
@tobio tobio force-pushed the api-key-expiration branch 3 times, most recently from ffaead5 to ac6dc62 Compare October 24, 2024 23:58
@tobio tobio force-pushed the api-key-expiration branch from ac6dc62 to 12df04b Compare October 24, 2024 23:59
@tobio tobio merged commit 9d7343c into main Oct 25, 2024
41 checks passed
@tobio tobio deleted the api-key-expiration branch October 25, 2024 00:53
kjwardy pushed a commit to kjwardy/terraform-provider-elasticstack that referenced this pull request Nov 19, 2024
…PF migration (elastic#875)

* Don't force resource replacement when expiration is unset during SDK-PF migratino

* CHANGELOG.md
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug] 0.11.10 forces api key replacement due to whitespaces

2 participants